﻿$(document).ready(function () {
    $("#postlogin").click(function () {
        var username = $("#username").val();
        var password = $("#password").val();
        var captcha = $("#captcha").val();
        var html;
        $.post("/Action/Login.ashx", { username: username, password: password, captcha: captcha }, function (data) {
            if (data == "1") {
                top.location.href = '/Action/AdminList.ashx';
            }
            else if (data == "0") {
                html = "用户名或密码错误！请重新输入";
            }
            else if (data == "2") {
                html = "验证码错误！请重新输入";
            }
            else {
                html = "出现系统错误！请稍后登录";
            }
            $("#loginerror").html(html)
        });
    });
});
function refurbish() {
    $("#captchaimg").attr('src', "/Action/CaptCha.ashx?r=" + Math.random());
}